import {
	useCartStore
} from '@/stores/cart.js'
import {
	onShow
} from "@dcloudio/uni-app";
import {
	computed,
	watch
} from 'vue';
export default function() {
	// const rTotalCnt = computed(() => useCartStore().totalCnt)
	// watch(rTotalCnt, () => setBadge())
	const setBadge = () => {
		uni.setTabBarBadge({
			index: 2,
			text: useCartStore().totalCnt + ''
		})
	}
	onShow(() => setBadge())
	return {
		setBadge
	}
}